/**
 * @Project Name:nacos-studio
 * @Package Name:cn.hoofungson.nacos.studio.config
 * @Since JDK 1.8
 */
package cn.hoofungson.nacos.studio.config;

import cn.hoofungson.nacos.studio.domain.vo.config.ConfigVO;
import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: Nacos配置
 * @Author 胡松 hoofungson@163.com
 * @Date 2019-03-18 15:51
 * @Version V1.0
 */
@Configuration
public class NacosConfig {

    @NacosValue(value = "${user}", autoRefreshed = true)
    private String user;

    @NacosValue(value = "${password}", autoRefreshed = true)
    private String password;

    @NacosValue(value = "${url}", autoRefreshed = true)
    private String url;

    @Bean
    public ConfigVO initConfigVO() {
        return new ConfigVO(user, password, url);
    }
}
